package com.yzw.hello.model.pojos.business.tag;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.yzw.hello.model.pojos.business.video.Video;

@Entity
@Table(name = "tag")
public class Tag {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	@Column(nullable = false, updatable = true, length = 50)
	@NotNull
	@Length(max = 50, message = "名称不能超过{max}")
	private String name;
	
	@Column(nullable = false, updatable = true, length = 50)
	@NotNull
	@Length(max = 50, message = "名称不能超过{max}")
	private String descript;
	
	@ManyToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "tid")
	private Video video;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescript() {
		return descript;
	}

	public void setDescript(String descript) {
		this.descript = descript;
	}
	
}
